<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <my-parent-comp></my-parent-comp>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
    var vm = new Vue({
        el:'#app',
        components:{
            "my-parent-comp":{
                // 声明父组件
                template:"<div><h1>我的父组件</h1><my-child-comp></my-child-comp></div>",
                components:{
                    // 声明子组件
                    "my-child-comp":{
                        template:"<h3>子组件</h3>"
                    }
                    
                }
            }
        }
    })
    </script>
</body>
</html>